{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-10-30T05:19:49.601588Z",
     "start_time": "2020-10-30T05:19:48.738935Z"
    }
   },
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-10-30T05:21:10.653706Z",
     "start_time": "2020-10-30T05:20:48.591070Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>English (en)</th>\n",
       "      <th>Afrikaans (af)</th>\n",
       "      <th>Albanian (sq)</th>\n",
       "      <th>Amharic (am)</th>\n",
       "      <th>Arabic (ar)</th>\n",
       "      <th>Armenian (hy)</th>\n",
       "      <th>Azeerbaijani (az)</th>\n",
       "      <th>Basque (eu)</th>\n",
       "      <th>Belarusian (be)</th>\n",
       "      <th>Bengali (bn)</th>\n",
       "      <th>...</th>\n",
       "      <th>Positive</th>\n",
       "      <th>Negative</th>\n",
       "      <th>Anger</th>\n",
       "      <th>Anticipation</th>\n",
       "      <th>Disgust</th>\n",
       "      <th>Fear</th>\n",
       "      <th>Joy</th>\n",
       "      <th>Sadness</th>\n",
       "      <th>Surprise</th>\n",
       "      <th>Trust</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>aback</td>\n",
       "      <td>uit die veld geslaan</td>\n",
       "      <td>prapa</td>\n",
       "      <td>ተጭኗል</td>\n",
       "      <td>الى الوراء</td>\n",
       "      <td>շեղում</td>\n",
       "      <td>sanki</td>\n",
       "      <td>aback</td>\n",
       "      <td>ззаду</td>\n",
       "      <td>পশ্চাতে</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>abacus</td>\n",
       "      <td>abakus</td>\n",
       "      <td>numërator</td>\n",
       "      <td>abacus</td>\n",
       "      <td>طبلية تاج</td>\n",
       "      <td>անբավարարություն</td>\n",
       "      <td>abacus</td>\n",
       "      <td>abako</td>\n",
       "      <td>абака</td>\n",
       "      <td>গণনা-যন্ত্রবিশেষ</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>abandon</td>\n",
       "      <td>verlaat</td>\n",
       "      <td>braktis</td>\n",
       "      <td>ውጣ</td>\n",
       "      <td>تخلى</td>\n",
       "      <td>լքել</td>\n",
       "      <td>tərk et</td>\n",
       "      <td>bertan behera</td>\n",
       "      <td>адмовіцца ад</td>\n",
       "      <td>বর্জিত করা</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>abandoned</td>\n",
       "      <td>verlate</td>\n",
       "      <td>braktisur</td>\n",
       "      <td>ተትቷል</td>\n",
       "      <td>مهجور</td>\n",
       "      <td>լքված</td>\n",
       "      <td>tərk etdi</td>\n",
       "      <td>abandonatutako</td>\n",
       "      <td>закінуты</td>\n",
       "      <td>পরিত্যক্ত</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>abandonment</td>\n",
       "      <td>verlating</td>\n",
       "      <td>braktisje</td>\n",
       "      <td>ማቋረጥ</td>\n",
       "      <td>التخلي عن</td>\n",
       "      <td>հրաժարվելով</td>\n",
       "      <td>ləğv</td>\n",
       "      <td>abandono</td>\n",
       "      <td>пакіданне</td>\n",
       "      <td>বিসর্জন</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 115 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "  English (en)        Afrikaans (af) Albanian (sq) Amharic (am) Arabic (ar)  \\\n",
       "0        aback  uit die veld geslaan         prapa         ተጭኗል  الى الوراء   \n",
       "1       abacus                abakus     numërator       abacus   طبلية تاج   \n",
       "2      abandon               verlaat       braktis           ውጣ        تخلى   \n",
       "3    abandoned               verlate     braktisur         ተትቷል       مهجور   \n",
       "4  abandonment             verlating     braktisje         ማቋረጥ   التخلي عن   \n",
       "\n",
       "      Armenian (hy) Azeerbaijani (az)     Basque (eu) Belarusian (be)  \\\n",
       "0            շեղում             sanki           aback           ззаду   \n",
       "1  անբավարարություն            abacus           abako           абака   \n",
       "2              լքել           tərk et   bertan behera    адмовіцца ад   \n",
       "3             լքված         tərk etdi  abandonatutako        закінуты   \n",
       "4       հրաժարվելով              ləğv        abandono       пакіданне   \n",
       "\n",
       "       Bengali (bn)  ... Positive Negative Anger Anticipation Disgust Fear  \\\n",
       "0           পশ্চাতে  ...        0        0     0            0       0    0   \n",
       "1  গণনা-যন্ত্রবিশেষ  ...        0        0     0            0       0    0   \n",
       "2        বর্জিত করা  ...        0        1     0            0       0    1   \n",
       "3         পরিত্যক্ত  ...        0        1     1            0       0    1   \n",
       "4           বিসর্জন  ...        0        1     1            0       0    1   \n",
       "\n",
       "  Joy Sadness Surprise Trust  \n",
       "0   0       0        0     0  \n",
       "1   0       0        0     1  \n",
       "2   0       1        0     0  \n",
       "3   0       1        0     0  \n",
       "4   0       1        1     0  \n",
       "\n",
       "[5 rows x 115 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lexion_df = pd.read_excel('./Textmining/NRC-Emotion-Lexicon-v0.92-In105Languages-Nov2017Translations.xlsx')\n",
    "lexion_df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-10-30T05:22:35.227709Z",
     "start_time": "2020-10-30T05:22:35.222655Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['English (en)',\n",
       " 'Afrikaans (af)',\n",
       " 'Albanian (sq)',\n",
       " 'Amharic (am)',\n",
       " 'Arabic (ar)',\n",
       " 'Armenian (hy)',\n",
       " 'Azeerbaijani (az)',\n",
       " 'Basque (eu)',\n",
       " 'Belarusian (be)',\n",
       " 'Bengali (bn)',\n",
       " 'Bosnian (bs)',\n",
       " 'Bulgarian (bg)',\n",
       " 'Catalan (ca)',\n",
       " 'Cebuano (ceb)',\n",
       " 'Chinese (Simplified) (zh-CN)',\n",
       " 'Chinese (Traditional) (zh-TW)',\n",
       " 'Corsican (co)',\n",
       " 'Croatian (hr)',\n",
       " 'Czech (cs)',\n",
       " 'Danish (da)',\n",
       " 'Dutch (nl)',\n",
       " 'English (en).1',\n",
       " 'Esperanto (eo)',\n",
       " 'Estonian (et)',\n",
       " 'Finnish (fi)',\n",
       " 'French (fr)',\n",
       " 'Frisian (fy)',\n",
       " 'Galician (gl)',\n",
       " 'Georgian (ka)',\n",
       " 'German (de)',\n",
       " 'Greek (el)',\n",
       " 'Gujarati (gu)',\n",
       " 'Haitian Creole (ht)',\n",
       " 'Hausa (ha)',\n",
       " 'Hawaiian (haw)',\n",
       " 'Hebrew (iw)',\n",
       " 'Hindi (hi)',\n",
       " 'Hmong (hmn)',\n",
       " 'Hungarian (hu)',\n",
       " 'Icelandic (is)',\n",
       " 'Igbo (ig)',\n",
       " 'Indonesian (id)',\n",
       " 'Irish (ga)',\n",
       " 'Italian (it)',\n",
       " 'Japanese (ja)',\n",
       " 'Javanese (jw)',\n",
       " 'Kannada (kn)',\n",
       " 'Kazakh (kk)',\n",
       " 'Khmer (km)',\n",
       " 'Korean (ko)',\n",
       " 'Kurdish (ku)',\n",
       " 'Kyrgyz (ky)',\n",
       " 'Lao (lo)',\n",
       " 'Latin (la)',\n",
       " 'Latvian (lv)',\n",
       " 'Lithuanian (lt)',\n",
       " 'Luxembourgish (lb)',\n",
       " 'Macedonian (mk)',\n",
       " 'Malagasy (mg)',\n",
       " 'Malay (ms)',\n",
       " 'Malayalam (ml)',\n",
       " 'Maltese (mt)',\n",
       " 'Maori (mi)',\n",
       " 'Marathi (mr)',\n",
       " 'Mongolian (mn)',\n",
       " 'Myanmar (Burmese) (my)',\n",
       " 'Nepali (ne)',\n",
       " 'Norwegian (no)',\n",
       " 'Nyanja (Chichewa) (ny)',\n",
       " 'Pashto (ps)',\n",
       " 'Persian (fa)',\n",
       " 'Polish (pl)',\n",
       " 'Portuguese (Portugal, Brazil) (pt)',\n",
       " 'Punjabi (pa)',\n",
       " 'Romanian (ro)',\n",
       " 'Russian (ru)',\n",
       " 'Samoan (sm)',\n",
       " 'Scots Gaelic (gd)',\n",
       " 'Serbian (sr)',\n",
       " 'Sesotho (st)',\n",
       " 'Shona (sn)',\n",
       " 'Sindhi (sd)',\n",
       " 'Sinhala (Sinhalese) (si)',\n",
       " 'Slovak (sk)',\n",
       " 'Slovenian (sl)',\n",
       " 'Somali (so)',\n",
       " 'Spanish (es)',\n",
       " 'Sundanese (su)',\n",
       " 'Swahili (sw)',\n",
       " 'Swedish (sv)',\n",
       " 'Tagalog (Filipino) (tl)',\n",
       " 'Tajik (tg)',\n",
       " 'Tamil (ta)',\n",
       " 'Telugu (te)',\n",
       " 'Thai (th)',\n",
       " 'Turkish (tr)',\n",
       " 'Ukrainian (uk)',\n",
       " 'Urdu (ur)',\n",
       " 'Uzbek (uz)',\n",
       " 'Vietnamese (vi)',\n",
       " 'Welsh (cy)',\n",
       " 'Xhosa (xh)',\n",
       " 'Yiddish (yi)',\n",
       " 'Yoruba (yo)',\n",
       " 'Zulu (zu)',\n",
       " 'Positive',\n",
       " 'Negative',\n",
       " 'Anger',\n",
       " 'Anticipation',\n",
       " 'Disgust',\n",
       " 'Fear',\n",
       " 'Joy',\n",
       " 'Sadness',\n",
       " 'Surprise',\n",
       " 'Trust']"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lexion_df.columns.tolist()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-10-30T05:22:59.166387Z",
     "start_time": "2020-10-30T05:22:59.151191Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Chinese (Simplified) (zh-CN)</th>\n",
       "      <th>Positive</th>\n",
       "      <th>Negative</th>\n",
       "      <th>Anger</th>\n",
       "      <th>Anticipation</th>\n",
       "      <th>Disgust</th>\n",
       "      <th>Fear</th>\n",
       "      <th>Joy</th>\n",
       "      <th>Sadness</th>\n",
       "      <th>Surprise</th>\n",
       "      <th>Trust</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>吓了一跳</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>算盘</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>放弃</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>弃</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>放弃</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Chinese (Simplified) (zh-CN)  Positive  Negative  Anger  Anticipation  \\\n",
       "0                         吓了一跳         0         0      0             0   \n",
       "1                           算盘         0         0      0             0   \n",
       "2                           放弃         0         1      0             0   \n",
       "3                            弃         0         1      1             0   \n",
       "4                           放弃         0         1      1             0   \n",
       "\n",
       "   Disgust  Fear  Joy  Sadness  Surprise  Trust  \n",
       "0        0     0    0        0         0      0  \n",
       "1        0     0    0        0         0      1  \n",
       "2        0     1    0        1         0      0  \n",
       "3        0     1    0        1         0      0  \n",
       "4        0     1    0        1         1      0  "
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "chinese_df = lexion_df[['Chinese (Simplified) (zh-CN)', 'Positive', 'Negative', \n",
    "                 'Anger','Anticipation', 'Disgust', 'Fear', 'Joy', 'Sadness', 'Surprise', 'Trust']]\n",
    "chinese_df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-10-30T05:24:30.423836Z",
     "start_time": "2020-10-30T05:24:27.841354Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "词语列表构建完成\n"
     ]
    }
   ],
   "source": [
    "# 构建情感词列表\n",
    "\n",
    "Positive = []\n",
    "Negative = []\n",
    "Anger = []\n",
    "Anticipation = []\n",
    "Disgust = []\n",
    "Fear = []\n",
    "Joy = []\n",
    "Sadness = []\n",
    "Surprise = []\n",
    "Trust = []\n",
    "for idx, row in chinese_df.iterrows():\n",
    "    if row['Positive']==1:\n",
    "        Positive.append(row['Chinese (Simplified) (zh-CN)'])\n",
    "    if row['Negative']==1:\n",
    "        Negative.append(row['Chinese (Simplified) (zh-CN)'])\n",
    "    if row['Anger']==1:\n",
    "        Anger.append(row['Chinese (Simplified) (zh-CN)'])\n",
    "    if row['Anticipation']==1:\n",
    "        Anticipation.append(row['Chinese (Simplified) (zh-CN)'])\n",
    "    if row['Disgust']==1:\n",
    "        Disgust.append(row['Chinese (Simplified) (zh-CN)'])\n",
    "    if row['Fear']==1:\n",
    "        Fear.append(row['Chinese (Simplified) (zh-CN)'])\n",
    "    if row['Joy']==1:\n",
    "        Joy.append(row['Chinese (Simplified) (zh-CN)'])\n",
    "    if row['Sadness']==1:\n",
    "        Sadness.append(row['Chinese (Simplified) (zh-CN)'])\n",
    "    if row['Surprise']==1:\n",
    "        Surprise.append(row['Chinese (Simplified) (zh-CN)'])\n",
    "    if row['Trust']==1:\n",
    "        Trust.append(row['Chinese (Simplified) (zh-CN)'])\n",
    "\n",
    "print('词语列表构建完成')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-10-30T05:27:49.407406Z",
     "start_time": "2020-10-30T05:27:49.401825Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0, 0]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "positive, negative, anger, anticipation, disgust, fear, joy, sadness, surprise, trust = [0 for i in range(10)]\n",
    "[positive, negative]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-10-30T05:28:45.665872Z",
     "start_time": "2020-10-30T05:28:45.656268Z"
    }
   },
   "outputs": [],
   "source": [
    "import jieba\n",
    "import time\n",
    "\n",
    "\n",
    "def emotion_caculate(text):\n",
    "    positive, negative, anger, anticipation, disgust, fear, joy, sadness, surprise, trust = [0 for i in range(10)]\n",
    "    \n",
    "    wordlist = jieba.lcut(text)\n",
    "    wordset = set(wordlist)\n",
    "    wordfreq = []\n",
    "    for word in wordset:\n",
    "        freq = wordlist.count(word)\n",
    "        if word in Positive:\n",
    "            positive+=freq\n",
    "        if word in Negative:\n",
    "            negative+=freq\n",
    "        if word in Anger:\n",
    "            anger+=freq  \n",
    "        if word in Anticipation:\n",
    "            anticipation+=freq\n",
    "        if word in Disgust:\n",
    "            disgust+=freq\n",
    "        if word in Fear:\n",
    "            fear+=freq\n",
    "        if word in Joy:\n",
    "            joy+=freq\n",
    "        if word in Sadness:\n",
    "            sadness+=freq\n",
    "        if word in Surprise:\n",
    "            surprise+=freq\n",
    "        if word in Trust:\n",
    "            trust+=freq\n",
    "            \n",
    "    emotion_info = {\n",
    "        'positive': positive,\n",
    "        'negative': negative,\n",
    "        'anger': anger,\n",
    "        'anticipation': anticipation,\n",
    "        'disgust': disgust,\n",
    "        'fear':fear,\n",
    "        'joy':joy,\n",
    "        'sadness':sadness,\n",
    "        'surprise':surprise,\n",
    "        'trust':trust,\n",
    "        'length':len(wordlist)\n",
    "    }\n",
    "    indexs = ['length', 'positive', 'negative', 'anger', 'anticipation','disgust','fear','joy','sadness','surprise','trust']\n",
    "    return pd.Series(emotion_info, index=indexs)\n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-10-30T05:28:46.477577Z",
     "start_time": "2020-10-30T05:28:46.462018Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "length          25\n",
       "positive         1\n",
       "negative         2\n",
       "anger            1\n",
       "anticipation     0\n",
       "disgust          1\n",
       "fear             1\n",
       "joy              0\n",
       "sadness          1\n",
       "surprise         0\n",
       "trust            3\n",
       "dtype: int64"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "emotion_caculate(text='这个国家再对这些制造假冒伪劣食品药品的人手软的话，那后果真的会相当糟糕。坐牢？从快判个死刑')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": false,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
